package data;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class ThreadMessage extends ForumMessage {
	private HashMap<Integer,PostMessage> _response;
	
	public ThreadMessage(Integer id, String title, String content, Member composer, Date date, Integer subForumID) {
		super(id, title, content, composer, date, subForumID);
		_response = new HashMap<Integer,PostMessage>();
	}
	
	public PostMessage getPostedMsg(Integer postIndex){
		return _response.get(postIndex);
	}
	
	public boolean containPost(Integer postId){
		return _response.containsKey(postId);
	}
	
	public void addNewResponse(PostMessage addedPostMsg) {
		_response.put(addedPostMsg.get_id(), addedPostMsg);
		
	}
	
	public void deletePostMsg(Integer postIndex){
		_response.remove(postIndex);
	}
	
	public Map<Integer,PostMessage> getResponse()
	{
		return this._response;
	}

}
